package jblip.resources;

import java.io.Serializable;
import java.util.Date;

/**
 * Resource encapsulating web links in blip messages.
 * 
 * <p>
 * Shortlinks are automatically generated web links used to provide compact
 * representation of user-provided URLs. Shortlinks are created by the blip
 * server as URLs in form:
 * </p>
 * <p>
 * <tt>http://rdir.pl/<i>shortcode</i></tt>
 * </p>
 * <p>
 * Either shortcode and the original URL can be obtained from <tt>Shortlink</tt>
 * resource implementation. As of API 0.02 the shortlinks are provided as a
 * separate resource only through an appropriate client call, while in other
 * cases they remain embedded as URLs in message bodies.
 * </p>
 * 
 * @author Krzysztof Sroka
 * @since 0.2
 */
public interface Shortlink extends Serializable {
  /**
   * Returns the ID of this shortlink.
   * 
   * @return the ID of this shortlink.
   */
  Integer getID();

  /**
   * Returns the URL to which this shortlink points.
   * 
   * @return the URL to which this shortlink points.
   */
  String getOriginalURL();

  /**
   * Returns hit count for this shortlink.
   * 
   * @return hit count for this shortlink.
   */
  Integer getHitCount();

  /**
   * Returns the shortcode of this shortlink.
   * 
   * <p>
   * See the {@link Shortlink} class description for information how does
   * shortcode correspond to shortlink's URL.
   * </p>
   * 
   * @return the shortcode of this shortlink.
   */
  String getShortcode();

  /**
   * Returns creation date/time for this shortlink.
   * 
   * @return creation date/time for this shortlink.
   */
  Date getCreatedAt();
}
